lib/deploy: Really close testing race condition
authorColin Walters <walters@verbum.org>
Wed, 16 Aug 2017 16:18:22 +0000 (12:18 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 16 Aug 2017 18:01:04 +0000 (18:01 +0000)
commitba28684ac2acd7dd97b1deeaf34259db023bad0e
tree1bbef3e2adc1abd6dde8b8c6a1720ed3421501c7
parenteb35821a5143d18104fdcde9646affcc04faa85e
lib/deploy: Really close testing race condition

I added `waitpid()`, but that didn't actually help because we were
`daemon()`izing. Don't daemonize if we're testing so that we can `waitpid()`.

Note I still haven't reproduced this race locally, but I'm pretty sure this will
fix it.

While here, actually check the return value from `waitpid()` just in case
something goes wrong there.

Closes: #1084
Approved by: jlebon
src/libostree/ostree-sysroot-deploy.c